package edu.sctu.wangxiaoqiang.day20150607;

import edu.sctu.nieyu.day20150526.Data;
import edu.sctu.wangxiaoqiang.day20150607.timer.Jishiqi;

import java.text.SimpleDateFormat;

/**
 * Created by user25 on 2015/6/7.
 */
public class Method {

    public void method(){
        PeopleAppbean people = new SetPeopleData().setPeopleData().get(0);

        if (people.isIs_card()) {
            if (new BaoGuoDeth(people).chaBaoGuo()) {
                System.out.println("包裹有违禁品,没收");
                System.out.println("进站计时开始"+new Jishiqi());
            } else {
                if (new BaoGuoDeth(people).chaWater()) {
                    System.out.println("水有问题");
                } else {
                    if (people.getPice() > 2) {
                        System.out.println("进站");
                    } else {
                        new CardDeth().setPrice(10, people);
                        System.out.println("充值成功");
                        System.out.println("进站计时开始"+new Jishiqi());

                    }
                    if(people.isIs_thief()){
                        System.out.println("有小偷，小心"+"报警");
                    }else{
                        System.out.println("很安全，和谐");
                    }
                    if (people.getPice() >= new CardDeth().getPrice(
                            people.getStart(), people.getEnd())) {
                        System.out.println("出站，余额为：:"
                                + (people.getPice() - new CardDeth().getPrice(
                                people.getStart(), people.getEnd())));
                    } else {
                        new CardDeth().setPrice(10, people);
                        System.out.println("充值成功");
                    }
                }

            }
        } else {
            System.out.println("买票");
            if (new BaoGuoDeth(people).chaBaoGuo()) {
                System.out.println("包裹有违禁品");
            } else {

                if(people.isIs_thief()){
                    System.out.println("有小偷，小心"+"报警");
                }else{
                    System.out.println("很安全，和谐");
                }
                if (new BaoGuoDeth(people).chaWater()) {
                    System.out.println("ˮ水有问题");
                }else {
                    System.out.println("出站");
                }
            }
        }

    }
}
